package com.itheima;

public class Demo04遍历 {
    public static void main(String[] args) {
        String s = "JohnWick";
        //循环
        for (int i = 0; i < s.length(); i++) {
            //根据索引获取字符
            char ch = s.charAt(i);
            //输出语句
            System.out.println(ch);
        }
    }
}
